using System;
using System.ComponentModel;
using System.Web.UI;
namespace JQueryControlToolkit.Controls
{
	[NonVisualControl]
	public class SortableExtender : UIExtender
	{
		[JQueryElement("connectWith", true)]
		public string ConnectSelector
		{
			get
			{
				return base.GetPropertyValue<string>("ConnectSelector", null);
			}
			set
			{
				base.SetPropertyValue<string>("ConnectSelector", value);
			}
		}
		[JQueryElement("dropOnEmpty")]
		public bool DropOnEmpty
		{
			get
			{
				return base.GetPropertyValue<bool>("DropOnEmpty", true);
			}
			set
			{
				base.SetPropertyValue<bool>("DropOnEmpty", value);
			}
		}
		[JQueryElement("forceHelperSize")]
		public bool ForceHelperSize
		{
			get
			{
				return base.GetPropertyValue<bool>("ForceHelperSize", false);
			}
			set
			{
				base.SetPropertyValue<bool>("ForceHelperSize", value);
			}
		}
		[JQueryElement("forcePlaceholderSize")]
		public bool ForcePlaceHolderSize
		{
			get
			{
				return base.GetPropertyValue<bool>("ForcePlaceHolderSize", false);
			}
			set
			{
				base.SetPropertyValue<bool>("ForcePlaceHolderSize", value);
			}
		}
		[JQueryElement("items", true)]
		public string ItemSelector
		{
			get
			{
				return base.GetPropertyValue<string>("ItemSelector", null);
			}
			set
			{
				base.SetPropertyValue<string>("ItemSelector", value);
			}
		}
		[JQueryElement("handle", true)]
		public string HandleSelector
		{
			get
			{
				return base.GetPropertyValue<string>("HandleSelector", null);
			}
			set
			{
				base.SetPropertyValue<string>("HandleSelector", value);
			}
		}
		[JQueryElement("placeholder", false, SerializeAs = SerializeAs.String)]
		public string DropPlaceHolderCssClass
		{
			get
			{
				return base.GetPropertyValue<string>("DropPlaceHolderCssClass", null);
			}
			set
			{
				base.SetPropertyValue<string>("DropPlaceHolderCssClass", value);
				this.ForcePlaceHolderSize = !string.IsNullOrEmpty(value);
			}
		}
		[JQueryEvent("start"), DefaultValue(null), DesignerSerializationVisibility(DesignerSerializationVisibility.Content), PersistenceMode(PersistenceMode.InnerProperty)]
		public string OnStart
		{
			get
			{
				return base.GetPropertyValue<string>("OnStart", null);
			}
			set
			{
				base.SetPropertyValue<string>("OnStart", value);
			}
		}
		[JQueryEvent("sort"), DefaultValue(null), DesignerSerializationVisibility(DesignerSerializationVisibility.Content), PersistenceMode(PersistenceMode.InnerProperty)]
		public string OnSort
		{
			get
			{
				return base.GetPropertyValue<string>("OnSort", null);
			}
			set
			{
				base.SetPropertyValue<string>("OnSort", value);
			}
		}
		[JQueryEvent("change"), DefaultValue(null), DesignerSerializationVisibility(DesignerSerializationVisibility.Content), PersistenceMode(PersistenceMode.InnerProperty)]
		public string OnChange
		{
			get
			{
				return base.GetPropertyValue<string>("OnChange", null);
			}
			set
			{
				base.SetPropertyValue<string>("OnChange", value);
			}
		}
		[JQueryEvent("beforeStop"), DefaultValue(null), DesignerSerializationVisibility(DesignerSerializationVisibility.Content), PersistenceMode(PersistenceMode.InnerProperty)]
		public string OnBeforeStop
		{
			get
			{
				return base.GetPropertyValue<string>("OnBeforeStop", null);
			}
			set
			{
				base.SetPropertyValue<string>("OnBeforeStop", value);
			}
		}
		[JQueryEvent("stop"), DefaultValue(null), DesignerSerializationVisibility(DesignerSerializationVisibility.Content), PersistenceMode(PersistenceMode.InnerProperty)]
		public string OnStop
		{
			get
			{
				return base.GetPropertyValue<string>("OnStop", null);
			}
			set
			{
				base.SetPropertyValue<string>("OnStop", value);
			}
		}
		[JQueryEvent("update"), DefaultValue(null), DesignerSerializationVisibility(DesignerSerializationVisibility.Content), PersistenceMode(PersistenceMode.InnerProperty)]
		public string OnUpdate
		{
			get
			{
				return base.GetPropertyValue<string>("OnUpdate", null);
			}
			set
			{
				base.SetPropertyValue<string>("OnUpdate", value);
			}
		}
		[JQueryEvent("receive"), DefaultValue(null), DesignerSerializationVisibility(DesignerSerializationVisibility.Content), PersistenceMode(PersistenceMode.InnerProperty)]
		public string OnReceive
		{
			get
			{
				return base.GetPropertyValue<string>("OnReceive", null);
			}
			set
			{
				base.SetPropertyValue<string>("OnReceive", value);
			}
		}
		[JQueryEvent("remove"), DefaultValue(null), DesignerSerializationVisibility(DesignerSerializationVisibility.Content), PersistenceMode(PersistenceMode.InnerProperty)]
		public string OnRemove
		{
			get
			{
				return base.GetPropertyValue<string>("OnRemove", null);
			}
			set
			{
				base.SetPropertyValue<string>("OnRemove", value);
			}
		}
		[JQueryEvent("over"), DefaultValue(null), DesignerSerializationVisibility(DesignerSerializationVisibility.Content), PersistenceMode(PersistenceMode.InnerProperty)]
		public string OnOver
		{
			get
			{
				return base.GetPropertyValue<string>("OnOver", null);
			}
			set
			{
				base.SetPropertyValue<string>("OnOver", value);
			}
		}
		[JQueryEvent("out"), DefaultValue(null), DesignerSerializationVisibility(DesignerSerializationVisibility.Content), PersistenceMode(PersistenceMode.InnerProperty)]
		public string OnOut
		{
			get
			{
				return base.GetPropertyValue<string>("OnOut", null);
			}
			set
			{
				base.SetPropertyValue<string>("OnOut", value);
			}
		}
		[JQueryEvent("activate"), DefaultValue(null), DesignerSerializationVisibility(DesignerSerializationVisibility.Content), PersistenceMode(PersistenceMode.InnerProperty)]
		public string OnActivate
		{
			get
			{
				return base.GetPropertyValue<string>("OnActivate", null);
			}
			set
			{
				base.SetPropertyValue<string>("OnActivate", value);
			}
		}
		[JQueryEvent("deactivate"), DefaultValue(null), DesignerSerializationVisibility(DesignerSerializationVisibility.Content), PersistenceMode(PersistenceMode.InnerProperty)]
		public string OnDeActivate
		{
			get
			{
				return base.GetPropertyValue<string>("OnDeActivate", null);
			}
			set
			{
				base.SetPropertyValue<string>("OnDeActivate", value);
			}
		}
		protected override string jQueryFunction
		{
			get
			{
				return "sortable";
			}
		}
		[JQueryElement(null, "appendTo", true, "parent")]
		public string AppendTo
		{
			get
			{
				return base.GetPropertyValue<string>("AppendTo", "parent");
			}
			set
			{
				base.SetPropertyValue<string>("AppendTo", value);
			}
		}
		[JQueryElement("axis")]
		public AxisRestriction AxisRestriction
		{
			get
			{
				return base.GetPropertyValue<AxisRestriction>("AxisRestriction", AxisRestriction.None);
			}
			set
			{
				base.SetPropertyValue<string>("AxisRestriction", value.ToString().ToLower());
			}
		}
		[JQueryElement("cancel", true)]
		public string Cancel
		{
			get
			{
				return base.GetPropertyValue<string>("Cancel", null);
			}
			set
			{
				base.SetPropertyValue<string>("Cancel", value);
			}
		}
		[JQueryElement(null, "containment", true, "parent|document|window|false")]
		public string Containment
		{
			get
			{
				return base.GetPropertyValue<string>("Containment", null);
			}
			set
			{
				if (this.ContainmentCoordinates == null)
				{
					base.SetPropertyValue<string>("Containment", value);
					return;
				}
				throw new NotSupportedException("You may not specify the containement type if you already have set up coordinates.");
			}
		}
		[JQueryElement(null, "containment", false, "\\[ ?[0-9]+, ?[0-9]+, ?[0-9]+, ?[0-9]+ ?\\]")]
		public string ContainmentCoordinates
		{
			get
			{
				return base.GetPropertyValue<string>("ContainmentCoordinates", null);
			}
			set
			{
				if (this.Containment == null)
				{
					base.SetPropertyValue<string>("ContainmentCoordinates", value);
					return;
				}
				throw new NotSupportedException("You may not specify the coordinates if you have set up another containment type than the default one.");
			}
		}
		[JQueryElement("cursor")]
		public string Cursor
		{
			get
			{
				return base.GetPropertyValue<string>("Cursor", null);
			}
			set
			{
				base.SetPropertyValue<string>("Cursor", value);
			}
		}
		[JQueryElement(null, "cursorAt", false, "\\{ ?(top|left|right|bottom): ?-?[0-9]+(, ?(top|left|right|bottom): ?-?[0-9]+)? ?\\}")]
		public string CursorAt
		{
			get
			{
				return base.GetPropertyValue<string>("CursorAt", null);
			}
			set
			{
				base.SetPropertyValue<string>("CursorAt", value);
			}
		}
		[JQueryElement("delay")]
		public int Delay
		{
			get
			{
				return base.GetPropertyValue<int>("Delay", 0);
			}
			set
			{
				base.SetPropertyValue<int>("Delay", value);
			}
		}
		[JQueryElement("distance")]
		public int Distance
		{
			get
			{
				return base.GetPropertyValue<int>("Distance", 1);
			}
			set
			{
				base.SetPropertyValue<int>("Distance", value);
			}
		}
		[JQueryElement(null, "grid", false, "^(\\[[0-9]+,\\ ?[0-9]+\\])|false$")]
		public string Grid
		{
			get
			{
				return base.GetPropertyValue<string>("Grid", null);
			}
			set
			{
				base.SetPropertyValue<string>("Grid", value);
			}
		}
		[JQueryElement(null, "handle", true, "false")]
		public string Handle
		{
			get
			{
				return base.GetPropertyValue<string>("Handle", null);
			}
			set
			{
				base.SetPropertyValue<string>("Handle", value);
			}
		}
		[JQueryElement("helper")]
		public string Helper
		{
			get
			{
				return base.GetPropertyValue<string>("Helper", null);
			}
			set
			{
				base.SetPropertyValue<string>("Helper", value);
			}
		}
		[JQueryElement("opacity")]
		public float Opacity
		{
			get
			{
				return base.GetPropertyValue<float>("Opacity", -1f);
			}
			set
			{
				base.SetPropertyValue<float>("Opacity", value);
			}
		}
		[JQueryElement(null, "revert", false, SerializeAs.String, "^true|false|valid|invalid$")]
		public string Revert
		{
			get
			{
				return base.GetPropertyValue<string>("Revert", null);
			}
			set
			{
				base.SetPropertyValue<string>("Revert", value);
			}
		}
		[JQueryElement("scroll", false)]
		public bool Scroll
		{
			get
			{
				return base.GetPropertyValue<bool>("Scroll", true);
			}
			set
			{
				base.SetPropertyValue<bool>("Scroll", value);
			}
		}
		[JQueryElement("scrollSensitivity")]
		public int ScrollSensitivity
		{
			get
			{
				return base.GetPropertyValue<int>("ScrollSensitivity", 20);
			}
			set
			{
				base.SetPropertyValue<int>("ScrollSensitivity", value);
			}
		}
		[JQueryElement("scrollSpeed")]
		public int ScrollSpeed
		{
			get
			{
				return base.GetPropertyValue<int>("ScrollSpeed", 20);
			}
			set
			{
				base.SetPropertyValue<int>("ScrollSpeed", value);
			}
		}
		[JQueryElement("tolerance", SerializeAs = SerializeAs.String)]
		public Tolerance Tolerance
		{
			get
			{
				return base.GetPropertyValue<Tolerance>("Tolerance", Tolerance.Intersect);
			}
			set
			{
				base.SetPropertyValue<Tolerance>("Tolerance", value);
			}
		}
		[JQueryElement("zIndex")]
		public int ZIndex
		{
			get
			{
				return base.GetPropertyValue<int>("ZIndex", 1000);
			}
			set
			{
				base.SetPropertyValue<int>("ZIndex", value);
			}
		}
		public bool DisableSelection
		{
			get;
			set;
		}
		public SortableExtender()
		{
			this.DisableSelection = true;
			this.Revert = "invalid";
			base.ChangeMetadata("Stack", new JQueryElementAttribute(null, "stack", false, "^\\{ group: '" + string.Format(JQueryElementAttribute.VariableSelectorRegexPattern, "false") + "'(, min:[0-9]+)? \\}$"));
		}
		protected override void Render(HtmlTextWriter writer)
		{
			base.Render(writer);
			if (this.DisableSelection)
			{
				base.AddJQuery(new JQuery(this.EnsureFunctionCall().Selector + " " + this.HandleSelector).DisableSelection());
			}
		}
	}
}
